﻿namespace _2_NovaAdmin.Application.IntegrationEvents.Publishers;

public class UserCreatedIntegrationEventPublisher : IIntegrationEventHandler<UserCreatedDomainEvent>
{

    ICapPublisher _capPublisher;
    public UserCreatedIntegrationEventPublisher(ICapPublisher capPublisher)
    {
        _capPublisher = capPublisher;
    }

    public async Task Handle(UserCreatedDomainEvent notification, CancellationToken cancellationToken)
    {
        await _capPublisher.PublishAsync("user.created", notification.user);
    }
}
